<?php
$this->headTitle('Write Your Post');
$this->placeholder('content_title')->set('Write Your Post');
$this->placeholder('body_onload')->set('document.posteditform.post_title.focus();');

/*
$dojoConfig = Zend::initConfig('Dojo');
if ($dojoConfig->enable) {
    $this->headScript()->setAllowArbitraryAttributes($dojoConfig->allowArbitraryAttributes);
    $this->headScript()->appendFile($dojoConfig->path . '/dojo/dojo.js', 'text/javascript', array('djConfig' => 'parseOnLoad: true, isDebug: false'));
    $this->headLink()->appendStylesheet($dojoConfig->path . '/dojo/resources/dojo.css');
    $this->headLink()->appendStylesheet($dojoConfig->path . '/dijit/themes/tundra/tundra.css');
    $this->placeholder('body_theme')->set('tundra');
}

$this->headScript()->captureStart();
echo 'dojo.require("dojo.parser");', "\n";
echo 'dojo.require("dijit.Editor");', "\n";
$this->headScript()->captureEnd();
*/
?>

<form name="posteditform" id="posteditform" method="post" action="<?php echo $this->U('post', 'save'); ?>">
    <p>
        <label>Title<br />
            <input type="text" name="post_title" id="post_title" class="input" value="<?php echo $this->postTitle; ?>" size="50" tabindex="1" onkeyup="" />
        </label>
    </p>

    <p>
        <label>Content<br />
            <?php 
            require_once('resources/js/externals/fckeditor/fckeditor.php');
            $basePath = '/resources/js/externals/fckeditor/';
            $fckEditor = new FCKeditor('post_content') ;

            $fckEditor->Config['SkinPath']              = $basePath . 'editor/skins/silver/';
            //$fckEditor->Config['SkinPath']              = $basePath . 'editor/skins/office2003/';

            $fckEditor->Config['AutoDetectLanguage']	= false;
            $fckEditor->Config['DefaultLanguage']		= 'zh';

            $fckEditor->Width               = 640;
            $fckEditor->Height              = 320;
            $fckEditor->BasePath	        = $basePath;
            //$fckEditor->ToolbarSet         = '';
            $fckEditor->Value		        = $this->postContent;
            $fckEditor->Create(); 
            ?>
        </label>
    </p>

    <!-- <textarea name="field" width="200px" dojoType="dijit.Editor"></textarea> -->
    <!-- <textarea dojoType="dijit.Editor" height="200" plugins="['copy','cut','paste','|','bold','hyperlink']"></textarea> -->

    <input type="hidden" name="post_id" id="post_id" value="<?php echo $this->postId; ?>" />
    <input type="hidden" name="post_author_id" id="post_author_id" tabindex="2" value="<?php echo $this->authorId; ?>" />

    <p>
        <input type="submit" value="Save" />
    </p>

</form>
